package net.piggy.core.socket.common;


public class GatewayResult {
    private final String code;
    private final String info;
    private final Object data;

    protected GatewayResult(String code, String info, Object data) {
        this.code = code;
        this.info = info;
        this.data = data;
    }

    public static GatewayResult buildSuccess(Object data) {
        return new GatewayResult(AgreementConstant.ResponseCode._200.getCode(), AgreementConstant.ResponseCode._200.getInfo(), data);
    }

    public static GatewayResult buildError(String code, String info) {
        return new GatewayResult(code, info, null);
    }

    public String getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public Object getData() {
        return data;
    }

}
